package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BusinessTripsMapper;
import com.ruoyi.system.domain.BusinessTrips;
import com.ruoyi.system.service.IBusinessTripsService;

/**
 * 出差申请Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-21
 */
@Service
public class BusinessTripsServiceImpl implements IBusinessTripsService 
{
    @Autowired
    private BusinessTripsMapper businessTripsMapper;

    /**
     * 查询出差申请
     * 
     * @param id 出差申请主键
     * @return 出差申请
     */
    @Override
    public BusinessTrips selectBusinessTripsById(Long id)
    {
        return businessTripsMapper.selectBusinessTripsById(id);
    }

    /**
     * 查询出差申请列表
     * 
     * @param businessTrips 出差申请
     * @return 出差申请
     */
    @Override
    public List<BusinessTrips> selectBusinessTripsList(BusinessTrips businessTrips)
    {
        return businessTripsMapper.selectBusinessTripsList(businessTrips);
    }

    /**
     * 新增出差申请
     * 
     * @param businessTrips 出差申请
     * @return 结果
     */
    @Override
    public int insertBusinessTrips(BusinessTrips businessTrips)
    {
        return businessTripsMapper.insertBusinessTrips(businessTrips);
    }

    /**
     * 修改出差申请
     * 
     * @param businessTrips 出差申请
     * @return 结果
     */
    @Override
    public int updateBusinessTrips(BusinessTrips businessTrips)
    {
        return businessTripsMapper.updateBusinessTrips(businessTrips);
    }

    /**
     * 批量删除出差申请
     * 
     * @param ids 需要删除的出差申请主键
     * @return 结果
     */
    @Override
    public int deleteBusinessTripsByIds(Long[] ids)
    {
        return businessTripsMapper.deleteBusinessTripsByIds(ids);
    }

    /**
     * 删除出差申请信息
     * 
     * @param id 出差申请主键
     * @return 结果
     */
    @Override
    public int deleteBusinessTripsById(Long id)
    {
        return businessTripsMapper.deleteBusinessTripsById(id);
    }

    @Override
    public int approveBusinessTrips(BusinessTrips businessTrips) {
        return  businessTripsMapper.approveBusinessTrips(businessTrips);
    }

    @Override
    public BusinessTrips selectBusinessApplyResultById(Long id) {
        return businessTripsMapper.selectBusinessApplyResultById(id);
    }


    @Override
    public List<BusinessTrips> selectCurrentUserBusinessTripsById(Long id) {
        return businessTripsMapper.selectCurrentUserBusinessTripsById(id);
    }

    @Override
    public List<BusinessTrips> selectDetailedBusinessTripsByIdAndInput(Long id, String status, String destination) {
        return businessTripsMapper.selectDetailedBusinessTripsByIdAndInput(id,status,destination);
    }
}
